import http from '@/http';
import config from '@/config'
class BaseRequest {
    constructor() {
        // 这里可以初始化实例变量，如appId等
    }

    // 发送验证码
    getCaptcha(phone, captchaVerification, type = 20) {
        return http.post(`${config.requestUrl}/cqliving-boot-sso/auth2/getCaptcha`, {
            appId: 1,
            phone,
            type,
            captchaVerification
        });
    }

    // 手机号绑定微信公众号
    userBindPhone({ openId, phone, captcha }) {
        return http.post(`${config.requestUrl}/cqliving-boot-sso/weChat/userBindPhoneCaptcha`, {
            openId,
            phoneNo: phone,
            appId: 1,
            captcha
        });
    }

    // 人机校验获取验证码
    dragVerifyGetCode(params) {
        return http.post(`${config.imgCode}/captcha/get`, params);
    }

    // 人机校验验证验证码正确性
    dragVerifyCheckCode(params) {
        return http.post(`${config.imgCode}/captcha/check`, params);
    }
}

export default new BaseRequest();